home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
126-150
/
disk_136
/
iff2pcs
/
source
/
pzutil.c
< prev
next >
Wrap
Text File
|
1992-05-06
|
755b
|
43 lines
/* Various small utility routines for IFF2PCS.
** Ali Ozer, Nov 1987
*/
unsigned long TimeInSecs ()
{
unsigned long datevec[3];
DateStamp (&datevec[0]);
return (datevec[0] * 86400L + datevec[1] * 60L + datevec[2] / 50L);
}
static unsigned long rndseed;
void InitRnd ()
{
unsigned long datevec[3];
DateStamp (&datevec[0]);
rndseed = datevec[1] * datevec[2];
}
int RndInt (min, max)
int min, max;
{
long res = (rndseed & 0x00000002L) | (rndseed & 0x00000010L);
rndseed >>= 1;
if (res == 0x00000012 || res == 0x00000000) rndseed |= 0x80000000L;
return ((((int)(rndseed & 0x00007fffL)) % (max + 1 - min)) + min);
}
int Min (a, b)
int a, b;
{
return ((a > b) ? b : a);
}
int Max (a, b)
int a, b;
{
return ((a > b) ? a : b);
}